﻿<%@ Page Title="" Language="C#" MasterPageFile="~/WebmasterTool/Admin.Master" AutoEventWireup="true" CodeBehind="Schedule.aspx.cs" Inherits="Framework.WebmasterTool.Schedule" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script type="text/javascript">
        $(document).ready(function () {
            $("#chkAll").live("change", function () {
                if ($(this).is(":checked")) {
                    $(".checkbox").attr("checked", "checked");
                }
                else {
                    $(".checkbox").removeAttr("checked");
                }
            });
            $(".checkbox").live("click", function () {
                var allCheck = true;
                $(".checkbox").each(function () {
                    if (!$(this).is(":checked")) {
                        allCheck = false;
                        return;
                    }
                });
                if (allCheck == true) {
                    $("#chkAll").attr("checked", "checked");
                }
                else {
                    $("#chkAll").removeAttr("checked");
                }
            });
        });
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ctlCaption" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="PageContent" runat="server">
     <asp:Label ID="lblPermissionMessage" runat="server" Font-Bold="true" ForeColor="Red"
        Text="Tài khoản không có quyền truy cập vào trang này" Visible="false"></asp:Label>
    <asp:Panel runat="server" ID="pnPermission">
        <asp:Panel runat="server" ID="pnAddnew" Visible="false">
            <table>
                <tr>
                    <td>Ngày
                    </td>
                    <td>
                        <asp:TextBox runat="server" Width="200" ID="txtDate"></asp:TextBox>
                        <i>(dd/mm/yyyy)</i>
                    </td>
                </tr>
                <tr>
                    <td>Ghi chú
                    </td>
                    <td>
                        <asp:TextBox Width="198" TextMode="MultiLine" Rows="5" runat="server" ID="txtNote"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td></td>
                    <td>
                        <asp:Button runat="server" ID="btnInsert" Text="Lưu" OnClick="btnInsert_Click" />
                    </td>
                </tr>
            </table>
        </asp:Panel>
        Năm
    <asp:TextBox runat="server" ID="txtYear"></asp:TextBox>
        <asp:Button runat="server" ID="btnSearch" OnClick="btnSearch_Click" Text="Tìm kiếm" />
        <asp:Button runat="server" ID="btnAddNew" OnClick="btnAddNew_Click" Text="Thêm mới" />
        <asp:Button runat="server" ID="btnDelete" Text="Xoá ngày đã chọn" OnClick="btnDelete_Click" />
        <br />
        <br />

        <asp:GridView runat="server" Width="785" ID="grvArticles" CssClass="grid" AutoGenerateColumns="false"
            AllowPaging="true" PageSize="10" AllowSorting="true" ToolTip="all"
            OnPageIndexChanging="grvArticles_PageIndexChanging">
            <Columns>
                <asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="20px" HeaderStyle-Width="20px">
                    <HeaderTemplate>
                        <input id="chkAll" type="checkbox" />
                    </HeaderTemplate>
                    <ItemTemplate>
                        <input id="chkSelect" runat="server" class="checkbox" type="checkbox" title='<%# Eval("ScheduleID") %>' />
                    </ItemTemplate>
                    <HeaderStyle Width="20px" />
                    <ItemStyle HorizontalAlign="Center" Width="20px" />
                </asp:TemplateField>

                <asp:TemplateField HeaderText="Ngày" SortExpression="Title" HeaderStyle-HorizontalAlign="Left"
                    ItemStyle-HorizontalAlign="left">
                    <ItemTemplate>
                        <label><%# Eval("ProcessDate") %></label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Ghi chú" SortExpression="Title" HeaderStyle-HorizontalAlign="Left"
                    ItemStyle-HorizontalAlign="left">
                    <ItemTemplate>
                        <label><%# Eval("Note") %></label>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
            <EmptyDataTemplate>
                <table align="center" width="300" border="0">
                    <tr>
                        <td height="50" align="center">
                            <div align="center">
                                Không có dữ liệu
                            </div>
                        </td>
                    </tr>
                </table>
            </EmptyDataTemplate>
            <PagerSettings Mode="NumericFirstLast" />
        </asp:GridView>
    </asp:Panel>
</asp:Content>
